// @Author EthanScriptOn
// @Desc
package queue

import (
	"errors"
	"math"
)

// ForwardQueue It is only used as a queue for forwarding, only in and out, and the push function needs to be implemented
type ForwardQueue struct {
	isClose bool
}

func GenerateForwardQueue() *ForwardQueue {
	return new(ForwardQueue)
}

// Pull Only in but not out can not be called
func (f *ForwardQueue) Pull() (interface{}, error) {
	panic(errors.New("cannot be called"))
}

// Push The function needs to be implemented
func (f *ForwardQueue) Push(data interface{}) {
	panic(errors.New("this function needs to be rewritten"))
}

func (f *ForwardQueue) Close() {
	f.isClose = true
}

func (f *ForwardQueue) IsClose() bool {
	return f.isClose
}

// QueueCap The optimal state of the queue
func (f *ForwardQueue) QueueCap() int {
	return math.MaxInt
}

// QueueLen The optimal state of the queue
func (f *ForwardQueue) QueueLen() int {
	return 0
}

// ProcessedTasks The optimal state of the queue
func (f *ForwardQueue) ProcessedTasks() int {
	return 0
}

// TasksTotal The optimal state of the queue
func (f *ForwardQueue) TasksTotal() int {
	return 0
}
